﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApp.Models
{
	public class DataSourceOne
	{

		static public IList<Calculation> GetCalculations()
		{
			var datatypes = GetDatatypes();

			var result = new List<Calculation>()
			{
				new Calculation()
				{
					Id = 1,
					Clause = "1+1-2",
					Datatype = datatypes.FirstOrDefault(x => x.Id == 1),
					DatatypeId = 1,
					Name = "First calc",
					Mnemonic = "mnem1"
				},
				new Calculation()
				{
					Id = 2,
					Clause = "(28-3)*3",
					Datatype = datatypes.FirstOrDefault(x => x.Id == 2),
					DatatypeId = 2,
					Name = "Second calc",
					Mnemonic = "mnem2"
				}
			};

			return result;
		}

		static public IList<Datatype> GetDatatypes()
		{
			return new List<Datatype>
			{
				new Datatype
				{
					Id = 1,
					Name = "String"
				},
				new Datatype
				{
					Id = 2,
					Name = "Number"
				}

			};
		}
	}
}